package net.oschina.j2cache;

import java.util.Collection;
import java.util.Properties;

/**
 * @author Winter Lau(javayou@gmail.com)
 */
public class NullCacheProvider implements CacheProvider {
  private static final NullCache NULL_CACHE = new NullCache();

  @Override
  public String name() {
    return "none";
  }

  @Override
  public int level() {
    return CacheObject.LEVEL_1 | CacheObject.LEVEL_2;
  }

  @Override
  public Cache buildCache(String regionName, CacheExpiredListener listener) throws CacheException {
    return NULL_CACHE;
  }

  @Override
  public Cache buildCache(String region, long timeToLiveInSeconds, CacheExpiredListener listener) {
    return NULL_CACHE;
  }

  @Override
  public Collection<CacheChannel.Region> regions() {
    return null;
  }

  @Override
  public void start(Properties props) throws CacheException {}

  @Override
  public void stop() {}
}
